////////////////////////////////////////////////////////////////////////////////
// The following FIT Protocol software provided may be used with FIT protocol
// devices only and remains the copyrighted property of Dynastream Innovations Inc.
// The software is being provided on an "as-is" basis and as an accommodation,
// and therefore all warranties, representations, or guarantees of any kind
// (whether express, implied or statutory) including, without limitation,
// warranties of merchantability, non-infringement, or fitness for a particular
// purpose, are specifically disclaimed.
//
// Copyright 2008 Dynastream Innovations Inc.
////////////////////////////////////////////////////////////////////////////////
// ****WARNING****  This file is auto-generated!  Do NOT edit this file.
// Profile Version = 1.50Release
// Tag = $Name: AKW1_500 $
////////////////////////////////////////////////////////////////////////////////


#if !defined(FIT_PROFILE_HPP)
#define FIT_PROFILE_HPP

#include <string>
#include "fit.hpp"
#include "fit_config.hpp"
#if defined(FIT_CPP_INCLUDE_C)
	#include "fit_product.h"
#endif


///////////////////////////////////////////////////////////////////////
// Public Definitions
///////////////////////////////////////////////////////////////////////

#if !defined(FIT_CPP_INCLUDE_C) // Types defined in fit_product.h if including C code.

///////////////////////////////////////////////////////////////////////
// Types
///////////////////////////////////////////////////////////////////////


typedef FIT_ENUM FIT_FILE;
#define FIT_FILE_INVALID                                                         FIT_ENUM_INVALID
#define FIT_FILE_DEVICE                                                          ((FIT_FILE)1) // Read only, single file. Must be in root directory.
#define FIT_FILE_SETTINGS                                                        ((FIT_FILE)2) // Read/write, single file. Directory=Settings
#define FIT_FILE_SPORT                                                           ((FIT_FILE)3) // Read/write, multiple files, file number = sport type. Directory=Sports
#define FIT_FILE_ACTIVITY                                                        ((FIT_FILE)4) // Read/erase, multiple files. Directory=Activities
#define FIT_FILE_WORKOUT                                                         ((FIT_FILE)5) // Read/write/erase, multiple files. Directory=Workouts
#define FIT_FILE_COURSE                                                          ((FIT_FILE)6) // Read/write/erase, multiple files. Directory=Courses
#define FIT_FILE_WEIGHT                                                          ((FIT_FILE)9) // Read only, single file. Circular buffer. All message definitions at start of file. Directory=Weight
#define FIT_FILE_TOTALS                                                          ((FIT_FILE)10) // Read only, single file. Directory=Totals
#define FIT_FILE_GOALS                                                           ((FIT_FILE)11) // Read/write, single file. Directory=Goals
#define FIT_FILE_BLOOD_PRESSURE                                                  ((FIT_FILE)14) // Read only. Directory=Blood Pressure
#define FIT_FILE_ACTIVITY_SUMMARY                                                ((FIT_FILE)20) // Read/erase, multiple files. Directory=Activities
#define FIT_FILE_COUNT                                                           11

typedef FIT_UINT16 FIT_MESG_NUM;
#define FIT_MESG_NUM_INVALID                                                     FIT_UINT16_INVALID
#define FIT_MESG_NUM_FILE_ID                                                     ((FIT_MESG_NUM)0)
#define FIT_MESG_NUM_CAPABILITIES                                                ((FIT_MESG_NUM)1)
#define FIT_MESG_NUM_DEVICE_SETTINGS                                             ((FIT_MESG_NUM)2)
#define FIT_MESG_NUM_USER_PROFILE                                                ((FIT_MESG_NUM)3)
#define FIT_MESG_NUM_HRM_PROFILE                                                 ((FIT_MESG_NUM)4)
#define FIT_MESG_NUM_SDM_PROFILE                                                 ((FIT_MESG_NUM)5)
#define FIT_MESG_NUM_BIKE_PROFILE                                                ((FIT_MESG_NUM)6)
#define FIT_MESG_NUM_ZONES_TARGET                                                ((FIT_MESG_NUM)7)
#define FIT_MESG_NUM_HR_ZONE                                                     ((FIT_MESG_NUM)8)
#define FIT_MESG_NUM_POWER_ZONE                                                  ((FIT_MESG_NUM)9)
#define FIT_MESG_NUM_MET_ZONE                                                    ((FIT_MESG_NUM)10)
#define FIT_MESG_NUM_SPORT                                                       ((FIT_MESG_NUM)12)
#define FIT_MESG_NUM_GOAL                                                        ((FIT_MESG_NUM)15)
#define FIT_MESG_NUM_SESSION                                                     ((FIT_MESG_NUM)18)
#define FIT_MESG_NUM_LAP                                                         ((FIT_MESG_NUM)19)
#define FIT_MESG_NUM_RECORD                                                      ((FIT_MESG_NUM)20)
#define FIT_MESG_NUM_EVENT                                                       ((FIT_MESG_NUM)21)
#define FIT_MESG_NUM_DEVICE_INFO                                                 ((FIT_MESG_NUM)23)
#define FIT_MESG_NUM_WORKOUT                                                     ((FIT_MESG_NUM)26)
#define FIT_MESG_NUM_WORKOUT_STEP                                                ((FIT_MESG_NUM)27)
#define FIT_MESG_NUM_WEIGHT_SCALE                                                ((FIT_MESG_NUM)30)
#define FIT_MESG_NUM_COURSE                                                      ((FIT_MESG_NUM)31)
#define FIT_MESG_NUM_COURSE_POINT                                                ((FIT_MESG_NUM)32)
#define FIT_MESG_NUM_TOTALS                                                      ((FIT_MESG_NUM)33)
#define FIT_MESG_NUM_ACTIVITY                                                    ((FIT_MESG_NUM)34)
#define FIT_MESG_NUM_SOFTWARE                                                    ((FIT_MESG_NUM)35)
#define FIT_MESG_NUM_FILE_CAPABILITIES                                           ((FIT_MESG_NUM)37)
#define FIT_MESG_NUM_MESG_CAPABILITIES                                           ((FIT_MESG_NUM)38)
#define FIT_MESG_NUM_FIELD_CAPABILITIES                                          ((FIT_MESG_NUM)39)
#define FIT_MESG_NUM_FILE_CREATOR                                                ((FIT_MESG_NUM)49)
#define FIT_MESG_NUM_BLOOD_PRESSURE                                              ((FIT_MESG_NUM)51)
#define FIT_MESG_NUM_HRV                                                         ((FIT_MESG_NUM)78)
#define FIT_MESG_NUM_PAD                                                         ((FIT_MESG_NUM)105)
#define FIT_MESG_NUM_MFG_RANGE_MIN                                               ((FIT_MESG_NUM)0xFF00) // 0xFF00 - 0xFFFE reserved for manufacturer specific messages
#define FIT_MESG_NUM_MFG_RANGE_MAX                                               ((FIT_MESG_NUM)0xFFFE) // 0xFF00 - 0xFFFE reserved for manufacturer specific messages
#define FIT_MESG_NUM_COUNT                                                       35

typedef FIT_UINT8 FIT_CHECKSUM;
#define FIT_CHECKSUM_INVALID                                                     FIT_UINT8_INVALID
#define FIT_CHECKSUM_CLEAR                                                       ((FIT_CHECKSUM)0) // Allows clear of checksum for flash memory where can only write 1 to 0 without erasing sector.
#define FIT_CHECKSUM_OK                                                          ((FIT_CHECKSUM)1) // Set to mark checksum as valid if computes to invalid values 0 or 0xFF.  Checksum can also be set to ok to save encoding computation time.
#define FIT_CHECKSUM_COUNT                                                       2

typedef FIT_UINT8Z FIT_FILE_FLAGS;
#define FIT_FILE_FLAGS_INVALID                                                   FIT_UINT8Z_INVALID
#define FIT_FILE_FLAGS_READ                                                      ((FIT_FILE_FLAGS)0x02)
#define FIT_FILE_FLAGS_WRITE                                                     ((FIT_FILE_FLAGS)0x04)
#define FIT_FILE_FLAGS_ERASE                                                     ((FIT_FILE_FLAGS)0x08)
#define FIT_FILE_FLAGS_COUNT                                                     3

typedef FIT_ENUM FIT_MESG_COUNT;
#define FIT_MESG_COUNT_INVALID                                                   FIT_ENUM_INVALID
#define FIT_MESG_COUNT_NUM_PER_FILE                                              ((FIT_MESG_COUNT)0)
#define FIT_MESG_COUNT_MAX_PER_FILE                                              ((FIT_MESG_COUNT)1)
#define FIT_MESG_COUNT_MAX_PER_FILE_TYPE                                         ((FIT_MESG_COUNT)2)
#define FIT_MESG_COUNT_COUNT                                                     3

typedef FIT_UINT32 FIT_DATE_TIME; // seconds since UTC 00:00 Dec 31 1989
#define FIT_DATE_TIME_INVALID                                                    FIT_UINT32_INVALID
#define FIT_DATE_TIME_MIN                                                        ((FIT_DATE_TIME)0x10000000) // if date_time is < 0x10000000 then it is system time (seconds from device power on)
#define FIT_DATE_TIME_COUNT                                                      1

typedef FIT_UINT32 FIT_LOCAL_DATE_TIME; // seconds since 00:00 Dec 31 1989 in local time zone
#define FIT_LOCAL_DATE_TIME_INVALID                                              FIT_UINT32_INVALID
#define FIT_LOCAL_DATE_TIME_COUNT                                                0

typedef FIT_UINT16 FIT_MESSAGE_INDEX;
#define FIT_MESSAGE_INDEX_INVALID                                                FIT_UINT16_INVALID
#define FIT_MESSAGE_INDEX_SELECTED                                               ((FIT_MESSAGE_INDEX)0x8000) // message is selected if set
#define FIT_MESSAGE_INDEX_RESERVED                                               ((FIT_MESSAGE_INDEX)0x7000) // reserved (default 0)
#define FIT_MESSAGE_INDEX_MASK                                                   ((FIT_MESSAGE_INDEX)0x0FFF) // index
#define FIT_MESSAGE_INDEX_COUNT                                                  3

typedef FIT_UINT8 FIT_DEVICE_INDEX;
#define FIT_DEVICE_INDEX_INVALID                                                 FIT_UINT8_INVALID
#define FIT_DEVICE_INDEX_CREATOR                                                 ((FIT_DEVICE_INDEX)0) // Creator of the file is always device index 0.
#define FIT_DEVICE_INDEX_COUNT                                                   1

typedef FIT_ENUM FIT_GENDER;
#define FIT_GENDER_INVALID                                                       FIT_ENUM_INVALID
#define FIT_GENDER_FEMALE                                                        ((FIT_GENDER)0)
#define FIT_GENDER_MALE                                                          ((FIT_GENDER)1)
#define FIT_GENDER_COUNT                                                         2

typedef FIT_ENUM FIT_LANGUAGE;
#define FIT_LANGUAGE_INVALID                                                     FIT_ENUM_INVALID
#define FIT_LANGUAGE_ENGLISH                                                     ((FIT_LANGUAGE)0)
#define FIT_LANGUAGE_FRENCH                                                      ((FIT_LANGUAGE)1)
#define FIT_LANGUAGE_ITALIAN                                                     ((FIT_LANGUAGE)2)
#define FIT_LANGUAGE_GERMAN                                                      ((FIT_LANGUAGE)3)
#define FIT_LANGUAGE_SPANISH                                                     ((FIT_LANGUAGE)4)
#define FIT_LANGUAGE_CROATIAN                                                    ((FIT_LANGUAGE)5)
#define FIT_LANGUAGE_CZECH                                                       ((FIT_LANGUAGE)6)
#define FIT_LANGUAGE_DANISH                                                      ((FIT_LANGUAGE)7)
#define FIT_LANGUAGE_DUTCH                                                       ((FIT_LANGUAGE)8)
#define FIT_LANGUAGE_FINNISH                                                     ((FIT_LANGUAGE)9)
#define FIT_LANGUAGE_GREEK                                                       ((FIT_LANGUAGE)10)
#define FIT_LANGUAGE_HUNGARIAN                                                   ((FIT_LANGUAGE)11)
#define FIT_LANGUAGE_NORWEGIAN                                                   ((FIT_LANGUAGE)12)
#define FIT_LANGUAGE_POLISH                                                      ((FIT_LANGUAGE)13)
#define FIT_LANGUAGE_PORTUGUESE                                                  ((FIT_LANGUAGE)14)
#define FIT_LANGUAGE_SLOVAKIAN                                                   ((FIT_LANGUAGE)15)
#define FIT_LANGUAGE_SLOVENIAN                                                   ((FIT_LANGUAGE)16)
#define FIT_LANGUAGE_SWEDISH                                                     ((FIT_LANGUAGE)17)
#define FIT_LANGUAGE_RUSSIAN                                                     ((FIT_LANGUAGE)18)
#define FIT_LANGUAGE_TURKISH                                                     ((FIT_LANGUAGE)19)
#define FIT_LANGUAGE_LATVIAN                                                     ((FIT_LANGUAGE)20)
#define FIT_LANGUAGE_UKRAINIAN                                                   ((FIT_LANGUAGE)21)
#define FIT_LANGUAGE_ARABIC                                                      ((FIT_LANGUAGE)22)
#define FIT_LANGUAGE_FARSI                                                       ((FIT_LANGUAGE)23)
#define FIT_LANGUAGE_BULGARIAN                                                   ((FIT_LANGUAGE)24)
#define FIT_LANGUAGE_ROMANIAN                                                    ((FIT_LANGUAGE)25)
#define FIT_LANGUAGE_CUSTOM                                                      ((FIT_LANGUAGE)254)
#define FIT_LANGUAGE_COUNT                                                       27

typedef FIT_ENUM FIT_DISPLAY_MEASURE;
#define FIT_DISPLAY_MEASURE_INVALID                                              FIT_ENUM_INVALID
#define FIT_DISPLAY_MEASURE_METRIC                                               ((FIT_DISPLAY_MEASURE)0)
#define FIT_DISPLAY_MEASURE_STATUTE                                              ((FIT_DISPLAY_MEASURE)1)
#define FIT_DISPLAY_MEASURE_COUNT                                                2

typedef FIT_ENUM FIT_DISPLAY_HEART;
#define FIT_DISPLAY_HEART_INVALID                                                FIT_ENUM_INVALID
#define FIT_DISPLAY_HEART_BPM                                                    ((FIT_DISPLAY_HEART)0)
#define FIT_DISPLAY_HEART_MAX                                                    ((FIT_DISPLAY_HEART)1)
#define FIT_DISPLAY_HEART_RESERVE                                                ((FIT_DISPLAY_HEART)2)
#define FIT_DISPLAY_HEART_COUNT                                                  3

typedef FIT_ENUM FIT_DISPLAY_POWER;
#define FIT_DISPLAY_POWER_INVALID                                                FIT_ENUM_INVALID
#define FIT_DISPLAY_POWER_WATTS                                                  ((FIT_DISPLAY_POWER)0)
#define FIT_DISPLAY_POWER_PERCENT_FTP                                            ((FIT_DISPLAY_POWER)1)
#define FIT_DISPLAY_POWER_COUNT                                                  2

typedef FIT_ENUM FIT_DISPLAY_POSITION;
#define FIT_DISPLAY_POSITION_INVALID                                             FIT_ENUM_INVALID
#define FIT_DISPLAY_POSITION_DEGREE                                              ((FIT_DISPLAY_POSITION)0) // dd.dddddd                       
#define FIT_DISPLAY_POSITION_DEGREE_MINUTE                                       ((FIT_DISPLAY_POSITION)1) // dddmm.mmm                       
#define FIT_DISPLAY_POSITION_DEGREE_MINUTE_SECOND                                ((FIT_DISPLAY_POSITION)2) // dddmmss                         
#define FIT_DISPLAY_POSITION_AUSTRIAN_GRID                                       ((FIT_DISPLAY_POSITION)3) // Austrian Grid (BMN)             
#define FIT_DISPLAY_POSITION_BRITISH_GRID                                        ((FIT_DISPLAY_POSITION)4) // British National Grid           
#define FIT_DISPLAY_POSITION_DUTCH_GRID                                          ((FIT_DISPLAY_POSITION)5) // Dutch grid system               
#define FIT_DISPLAY_POSITION_HUNGARIAN_GRID                                      ((FIT_DISPLAY_POSITION)6) // Hungarian grid system           
#define FIT_DISPLAY_POSITION_FINNISH_GRID                                        ((FIT_DISPLAY_POSITION)7) // Finnish grid system Zone3 KKJ27 
#define FIT_DISPLAY_POSITION_GERMAN_GRID                                         ((FIT_DISPLAY_POSITION)8) // Gausss Krueger (German)         
#define FIT_DISPLAY_POSITION_ICELANDIC_GRID                                      ((FIT_DISPLAY_POSITION)9) // Icelandic Grid                  
#define FIT_DISPLAY_POSITION_INDONESIAN_EQUATORIAL                               ((FIT_DISPLAY_POSITION)10) // Indonesian Equatorial LCO       
#define FIT_DISPLAY_POSITION_INDONESIAN_IRIAN                                    ((FIT_DISPLAY_POSITION)11) // Indonesian Irian LCO            
#define FIT_DISPLAY_POSITION_INDONESIAN_SOUTHERN                                 ((FIT_DISPLAY_POSITION)12) // Indonesian Southern LCO         
#define FIT_DISPLAY_POSITION_INDIA_ZONE_0                                        ((FIT_DISPLAY_POSITION)13) // India zone 0                    
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IA                                       ((FIT_DISPLAY_POSITION)14) // India zone IA                   
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IB                                       ((FIT_DISPLAY_POSITION)15) // India zone IB                   
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IIA                                      ((FIT_DISPLAY_POSITION)16) // India zone IIA                  
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IIB                                      ((FIT_DISPLAY_POSITION)17) // India zone IIB                  
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IIIA                                     ((FIT_DISPLAY_POSITION)18) // India zone IIIA                 
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IIIB                                     ((FIT_DISPLAY_POSITION)19) // India zone IIIB                 
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IVA                                      ((FIT_DISPLAY_POSITION)20) // India zone IVA                  
#define FIT_DISPLAY_POSITION_INDIA_ZONE_IVB                                      ((FIT_DISPLAY_POSITION)21) // India zone IVB                  
#define FIT_DISPLAY_POSITION_IRISH_TRANSVERSE                                    ((FIT_DISPLAY_POSITION)22) // Irish Transverse Mercator       
#define FIT_DISPLAY_POSITION_IRISH_GRID                                          ((FIT_DISPLAY_POSITION)23) // Irish Grid                      
#define FIT_DISPLAY_POSITION_LORAN                                               ((FIT_DISPLAY_POSITION)24) // Loran TD                        
#define FIT_DISPLAY_POSITION_MAIDENHEAD_GRID                                     ((FIT_DISPLAY_POSITION)25) // Maidenhead grid system          
#define FIT_DISPLAY_POSITION_MGRS_GRID                                           ((FIT_DISPLAY_POSITION)26) // MGRS grid system                
#define FIT_DISPLAY_POSITION_NEW_ZEALAND_GRID                                    ((FIT_DISPLAY_POSITION)27) // New Zealand grid system         
#define FIT_DISPLAY_POSITION_NEW_ZEALAND_TRANSVERSE                              ((FIT_DISPLAY_POSITION)28) // New Zealand Transverse Mercator 
#define FIT_DISPLAY_POSITION_QATAR_GRID                                          ((FIT_DISPLAY_POSITION)29) // Qatar National Grid             
#define FIT_DISPLAY_POSITION_MODIFIED_SWEDISH_GRID                               ((FIT_DISPLAY_POSITION)30) // Modified RT-90 (Sweden)         
#define FIT_DISPLAY_POSITION_SWEDISH_GRID                                        ((FIT_DISPLAY_POSITION)31) // RT-90 (Sweden)                  
#define FIT_DISPLAY_POSITION_SOUTH_AFRICAN_GRID                                  ((FIT_DISPLAY_POSITION)32) // South African Grid              
#define FIT_DISPLAY_POSITION_SWISS_GRID                                          ((FIT_DISPLAY_POSITION)33) // Swiss CH-1903 grid              
#define FIT_DISPLAY_POSITION_TAIWAN_GRID                                         ((FIT_DISPLAY_POSITION)34) // Taiwan Grid                     
#define FIT_DISPLAY_POSITION_UNITED_STATES_GRID                                  ((FIT_DISPLAY_POSITION)35) // United States National Grid     
#define FIT_DISPLAY_POSITION_UTM_UPS_GRID                                        ((FIT_DISPLAY_POSITION)36) // UTM/UPS grid system             
#define FIT_DISPLAY_POSITION_WEST_MALAYAN                                        ((FIT_DISPLAY_POSITION)37) // West Malayan RSO                
#define FIT_DISPLAY_POSITION_BORNEO_RSO                                          ((FIT_DISPLAY_POSITION)38) // Borneo RSO
#define FIT_DISPLAY_POSITION_ESTONIAN_GRID                                       ((FIT_DISPLAY_POSITION)39) // Estonian grid system
#define FIT_DISPLAY_POSITION_LATVIAN_GRID                                        ((FIT_DISPLAY_POSITION)40) // Latvian Transverse Mercator
#define FIT_DISPLAY_POSITION_SWEDISH_REF_99_GRID                                 ((FIT_DISPLAY_POSITION)41) // Reference Grid 99 TM (Swedish)
#define FIT_DISPLAY_POSITION_COUNT                                               42

typedef FIT_ENUM FIT_SPORT;
#define FIT_SPORT_INVALID                                                        FIT_ENUM_INVALID
#define FIT_SPORT_GENERIC                                                        ((FIT_SPORT)0)
#define FIT_SPORT_RUNNING                                                        ((FIT_SPORT)1)
#define FIT_SPORT_CYCLING                                                        ((FIT_SPORT)2)
#define FIT_SPORT_TRANSITION                                                     ((FIT_SPORT)3) // Mulitsport transition
#define FIT_SPORT_FITNESS_EQUIPMENT                                              ((FIT_SPORT)4)
#define FIT_SPORT_SWIMMING                                                       ((FIT_SPORT)5)
#define FIT_SPORT_BASKETBALL                                                     ((FIT_SPORT)6)
#define FIT_SPORT_SOCCER                                                         ((FIT_SPORT)7)
#define FIT_SPORT_TENNIS                                                         ((FIT_SPORT)8)
#define FIT_SPORT_AMERICAN_FOOTBALL                                              ((FIT_SPORT)9)
#define FIT_SPORT_TRAINING                                                       ((FIT_SPORT)10)
#define FIT_SPORT_ALL                                                            ((FIT_SPORT)254) // All is for goals only to include all sports.
#define FIT_SPORT_COUNT                                                          12

typedef FIT_UINT8Z FIT_SPORT_BITS_0; // Bit field corresponding to sport enum type (1 << sport).
#define FIT_SPORT_BITS_0_INVALID                                                 FIT_UINT8Z_INVALID
#define FIT_SPORT_BITS_0_GENERIC                                                 ((FIT_SPORT_BITS_0)0x01)
#define FIT_SPORT_BITS_0_RUNNING                                                 ((FIT_SPORT_BITS_0)0x02)
#define FIT_SPORT_BITS_0_CYCLING                                                 ((FIT_SPORT_BITS_0)0x04)
#define FIT_SPORT_BITS_0_TRANSITION                                              ((FIT_SPORT_BITS_0)0x08) // Mulitsport transition
#define FIT_SPORT_BITS_0_FITNESS_EQUIPMENT                                       ((FIT_SPORT_BITS_0)0x10)
#define FIT_SPORT_BITS_0_SWIMMING                                                ((FIT_SPORT_BITS_0)0x20)
#define FIT_SPORT_BITS_0_BASKETBALL                                              ((FIT_SPORT_BITS_0)0x40)
#define FIT_SPORT_BITS_0_SOCCER                                                  ((FIT_SPORT_BITS_0)0x80)
#define FIT_SPORT_BITS_0_COUNT                                                   8

typedef FIT_UINT8Z FIT_SPORT_BITS_1; // Bit field corresponding to sport enum type (1 << (sport-8)).
#define FIT_SPORT_BITS_1_INVALID                                                 FIT_UINT8Z_INVALID
#define FIT_SPORT_BITS_1_TENNIS                                                  ((FIT_SPORT_BITS_1)0x01)
#define FIT_SPORT_BITS_1_AMERICAN_FOOTBALL                                       ((FIT_SPORT_BITS_1)0x02)
#define FIT_SPORT_BITS_1_TRAINING                                                ((FIT_SPORT_BITS_1)0x04)
#define FIT_SPORT_BITS_1_COUNT                                                   3

typedef FIT_ENUM FIT_SUB_SPORT;
#define FIT_SUB_SPORT_INVALID                                                    FIT_ENUM_INVALID
#define FIT_SUB_SPORT_GENERIC                                                    ((FIT_SUB_SPORT)0)
#define FIT_SUB_SPORT_TREADMILL                                                  ((FIT_SUB_SPORT)1) // Run
#define FIT_SUB_SPORT_STREET                                                     ((FIT_SUB_SPORT)2) // Run
#define FIT_SUB_SPORT_TRAIL                                                      ((FIT_SUB_SPORT)3) // Run
#define FIT_SUB_SPORT_TRACK                                                      ((FIT_SUB_SPORT)4) // Run
#define FIT_SUB_SPORT_SPIN                                                       ((FIT_SUB_SPORT)5) // Cycling
#define FIT_SUB_SPORT_INDOOR_CYCLING                                             ((FIT_SUB_SPORT)6) // Cycling
#define FIT_SUB_SPORT_ROAD                                                       ((FIT_SUB_SPORT)7) // Cycling
#define FIT_SUB_SPORT_MOUNTAIN                                                   ((FIT_SUB_SPORT)8) // Cycling
#define FIT_SUB_SPORT_DOWNHILL                                                   ((FIT_SUB_SPORT)9) // Cycling
#define FIT_SUB_SPORT_RECUMBENT                                                  ((FIT_SUB_SPORT)10) // Cycling
#define FIT_SUB_SPORT_CYCLOCROSS                                                 ((FIT_SUB_SPORT)11) // Cycling
#define FIT_SUB_SPORT_HAND_CYCLING                                               ((FIT_SUB_SPORT)12) // Cycling
#define FIT_SUB_SPORT_TRACK_CYCLING                                              ((FIT_SUB_SPORT)13) // Cycling
#define FIT_SUB_SPORT_INDOOR_ROWING                                              ((FIT_SUB_SPORT)14) // Fitness Equipment
#define FIT_SUB_SPORT_ELLIPTICAL                                                 ((FIT_SUB_SPORT)15) // Fitness Equipment
#define FIT_SUB_SPORT_STAIR_CLIMBING                                             ((FIT_SUB_SPORT)16) // Fitness Equipment
#define FIT_SUB_SPORT_LAP_SWIMMING                                               ((FIT_SUB_SPORT)17) // Swimming
#define FIT_SUB_SPORT_OPEN_WATER                                                 ((FIT_SUB_SPORT)18) // Swimming
#define FIT_SUB_SPORT_FLEXIBILITY_TRAINING                                       ((FIT_SUB_SPORT)19) // Training
#define FIT_SUB_SPORT_STRENGTH_TRAINING                                          ((FIT_SUB_SPORT)20) // Training
#define FIT_SUB_SPORT_ALL                                                        ((FIT_SUB_SPORT)254)
#define FIT_SUB_SPORT_COUNT                                                      22

typedef FIT_ENUM FIT_ACTIVITY;
#define FIT_ACTIVITY_INVALID                                                     FIT_ENUM_INVALID
#define FIT_ACTIVITY_MANUAL                                                      ((FIT_ACTIVITY)0)
#define FIT_ACTIVITY_AUTO_MULTI_SPORT                                            ((FIT_ACTIVITY)1)
#define FIT_ACTIVITY_COUNT                                                       2

typedef FIT_ENUM FIT_INTENSITY;
#define FIT_INTENSITY_INVALID                                                    FIT_ENUM_INVALID
#define FIT_INTENSITY_ACTIVE                                                     ((FIT_INTENSITY)0)
#define FIT_INTENSITY_REST                                                       ((FIT_INTENSITY)1)
#define FIT_INTENSITY_WARMUP                                                     ((FIT_INTENSITY)2)
#define FIT_INTENSITY_COOLDOWN                                                   ((FIT_INTENSITY)3)
#define FIT_INTENSITY_COUNT                                                      4

typedef FIT_ENUM FIT_SESSION_TRIGGER;
#define FIT_SESSION_TRIGGER_INVALID                                              FIT_ENUM_INVALID
#define FIT_SESSION_TRIGGER_ACTIVITY_END                                         ((FIT_SESSION_TRIGGER)0)
#define FIT_SESSION_TRIGGER_MANUAL                                               ((FIT_SESSION_TRIGGER)1) // User changed sport.
#define FIT_SESSION_TRIGGER_AUTO_MULTI_SPORT                                     ((FIT_SESSION_TRIGGER)2) // Auto multi-sport feature is enabled and user pressed lap button to advance session.
#define FIT_SESSION_TRIGGER_FITNESS_EQUIPMENT                                    ((FIT_SESSION_TRIGGER)3) // Auto sport change caused by user linking to fitness equipment.
#define FIT_SESSION_TRIGGER_COUNT                                                4

typedef FIT_ENUM FIT_AUTOLAP_TRIGGER;
#define FIT_AUTOLAP_TRIGGER_INVALID                                              FIT_ENUM_INVALID
#define FIT_AUTOLAP_TRIGGER_TIME                                                 ((FIT_AUTOLAP_TRIGGER)0)
#define FIT_AUTOLAP_TRIGGER_DISTANCE                                             ((FIT_AUTOLAP_TRIGGER)1)
#define FIT_AUTOLAP_TRIGGER_POSITION_START                                       ((FIT_AUTOLAP_TRIGGER)2)
#define FIT_AUTOLAP_TRIGGER_POSITION_LAP                                         ((FIT_AUTOLAP_TRIGGER)3)
#define FIT_AUTOLAP_TRIGGER_POSITION_WAYPOINT                                    ((FIT_AUTOLAP_TRIGGER)4)
#define FIT_AUTOLAP_TRIGGER_POSITION_MARKED                                      ((FIT_AUTOLAP_TRIGGER)5)
#define FIT_AUTOLAP_TRIGGER_OFF                                                  ((FIT_AUTOLAP_TRIGGER)6)
#define FIT_AUTOLAP_TRIGGER_COUNT                                                7

typedef FIT_ENUM FIT_LAP_TRIGGER;
#define FIT_LAP_TRIGGER_INVALID                                                  FIT_ENUM_INVALID
#define FIT_LAP_TRIGGER_MANUAL                                                   ((FIT_LAP_TRIGGER)0)
#define FIT_LAP_TRIGGER_TIME                                                     ((FIT_LAP_TRIGGER)1)
#define FIT_LAP_TRIGGER_DISTANCE                                                 ((FIT_LAP_TRIGGER)2)
#define FIT_LAP_TRIGGER_POSITION_START                                           ((FIT_LAP_TRIGGER)3)
#define FIT_LAP_TRIGGER_POSITION_LAP                                             ((FIT_LAP_TRIGGER)4)
#define FIT_LAP_TRIGGER_POSITION_WAYPOINT                                        ((FIT_LAP_TRIGGER)5)
#define FIT_LAP_TRIGGER_POSITION_MARKED                                          ((FIT_LAP_TRIGGER)6)
#define FIT_LAP_TRIGGER_SESSION_END                                              ((FIT_LAP_TRIGGER)7)
#define FIT_LAP_TRIGGER_FITNESS_EQUIPMENT                                        ((FIT_LAP_TRIGGER)8)
#define FIT_LAP_TRIGGER_COUNT                                                    9

typedef FIT_ENUM FIT_EVENT;
#define FIT_EVENT_INVALID                                                        FIT_ENUM_INVALID
#define FIT_EVENT_TIMER                                                          ((FIT_EVENT)0) // Group 0.  Start / stop_all
#define FIT_EVENT_WORKOUT                                                        ((FIT_EVENT)3) // start / stop
#define FIT_EVENT_WORKOUT_STEP                                                   ((FIT_EVENT)4) // Start at beginning of workout.  Stop at end of each step.
#define FIT_EVENT_POWER_DOWN                                                     ((FIT_EVENT)5) // stop_all group 0
#define FIT_EVENT_POWER_UP                                                       ((FIT_EVENT)6) // stop_all group 0
#define FIT_EVENT_OFF_COURSE                                                     ((FIT_EVENT)7) // start / stop group 0
#define FIT_EVENT_SESSION                                                        ((FIT_EVENT)8) // Stop at end of each session.
#define FIT_EVENT_LAP                                                            ((FIT_EVENT)9) // Stop at end of each lap.
#define FIT_EVENT_COURSE_POINT                                                   ((FIT_EVENT)10) // marker
#define FIT_EVENT_BATTERY                                                        ((FIT_EVENT)11) // marker
#define FIT_EVENT_VIRTUAL_PARTNER_PACE                                           ((FIT_EVENT)12) // Group 1. Start at beginning of activity if VP enabled, when VP pace is changed during activity or VP enabled mid activity.  stop_disable when VP disabled.
#define FIT_EVENT_HR_HIGH_ALERT                                                  ((FIT_EVENT)13) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_HR_LOW_ALERT                                                   ((FIT_EVENT)14) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_SPEED_HIGH_ALERT                                               ((FIT_EVENT)15) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_SPEED_LOW_ALERT                                                ((FIT_EVENT)16) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_CAD_HIGH_ALERT                                                 ((FIT_EVENT)17) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_CAD_LOW_ALERT                                                  ((FIT_EVENT)18) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_POWER_HIGH_ALERT                                               ((FIT_EVENT)19) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_POWER_LOW_ALERT                                                ((FIT_EVENT)20) // Group 0.  Start / stop when in alert condition.
#define FIT_EVENT_RECOVERY_HR                                                    ((FIT_EVENT)21) // marker
#define FIT_EVENT_BATTERY_LOW                                                    ((FIT_EVENT)22) // marker
#define FIT_EVENT_TIME_DURATION_ALERT                                            ((FIT_EVENT)23) // Group 1.  Start if enabled mid activity (not required at start of activity). Stop when duration is reached.  stop_disable if disabled.
#define FIT_EVENT_DISTANCE_DURATION_ALERT                                        ((FIT_EVENT)24) // Group 1.  Start if enabled mid activity (not required at start of activity). Stop when duration is reached.  stop_disable if disabled.
#define FIT_EVENT_CALORIE_DURATION_ALERT                                         ((FIT_EVENT)25) // Group 1.  Start if enabled mid activity (not required at start of activity). Stop when duration is reached.  stop_disable if disabled.
#define FIT_EVENT_ACTIVITY                                                       ((FIT_EVENT)26) // Group 1..  Stop at end of activity.
#define FIT_EVENT_FITNESS_EQUIPMENT                                              ((FIT_EVENT)27) // marker
#define FIT_EVENT_COUNT                                                          26

typedef FIT_ENUM FIT_EVENT_TYPE;
#define FIT_EVENT_TYPE_INVALID                                                   FIT_ENUM_INVALID
#define FIT_EVENT_TYPE_START                                                     ((FIT_EVENT_TYPE)0)
#define FIT_EVENT_TYPE_STOP                                                      ((FIT_EVENT_TYPE)1)
#define FIT_EVENT_TYPE_CONSECUTIVE_DEPRECIATED                                   ((FIT_EVENT_TYPE)2)
#define FIT_EVENT_TYPE_MARKER                                                    ((FIT_EVENT_TYPE)3)
#define FIT_EVENT_TYPE_STOP_ALL                                                  ((FIT_EVENT_TYPE)4)
#define FIT_EVENT_TYPE_BEGIN_DEPRECIATED                                         ((FIT_EVENT_TYPE)5)
#define FIT_EVENT_TYPE_END_DEPRECIATED                                           ((FIT_EVENT_TYPE)6)
#define FIT_EVENT_TYPE_END_ALL_DEPRECIATED                                       ((FIT_EVENT_TYPE)7)
#define FIT_EVENT_TYPE_STOP_DISABLE                                              ((FIT_EVENT_TYPE)8)
#define FIT_EVENT_TYPE_STOP_DISABLE_ALL                                          ((FIT_EVENT_TYPE)9)
#define FIT_EVENT_TYPE_COUNT                                                     10

typedef FIT_ENUM FIT_TIMER_TRIGGER; // timer event data
#define FIT_TIMER_TRIGGER_INVALID                                                FIT_ENUM_INVALID
#define FIT_TIMER_TRIGGER_MANUAL                                                 ((FIT_TIMER_TRIGGER)0)
#define FIT_TIMER_TRIGGER_AUTO                                                   ((FIT_TIMER_TRIGGER)1)
#define FIT_TIMER_TRIGGER_FITNESS_EQUIPMENT                                      ((FIT_TIMER_TRIGGER)2)
#define FIT_TIMER_TRIGGER_COUNT                                                  3

typedef FIT_ENUM FIT_FITNESS_EQUIPMENT_STATE; // fitness equipment event data
#define FIT_FITNESS_EQUIPMENT_STATE_INVALID                                      FIT_ENUM_INVALID
#define FIT_FITNESS_EQUIPMENT_STATE_READY                                        ((FIT_FITNESS_EQUIPMENT_STATE)0)
#define FIT_FITNESS_EQUIPMENT_STATE_IN_USE                                       ((FIT_FITNESS_EQUIPMENT_STATE)1)
#define FIT_FITNESS_EQUIPMENT_STATE_PAUSED                                       ((FIT_FITNESS_EQUIPMENT_STATE)2)
#define FIT_FITNESS_EQUIPMENT_STATE_UNKNOWN                                      ((FIT_FITNESS_EQUIPMENT_STATE)3) // lost connection to fitness equipment
#define FIT_FITNESS_EQUIPMENT_STATE_COUNT                                        4

typedef FIT_ENUM FIT_ACTIVITY_CLASS;
#define FIT_ACTIVITY_CLASS_INVALID                                               FIT_ENUM_INVALID
#define FIT_ACTIVITY_CLASS_LEVEL                                                 ((FIT_ACTIVITY_CLASS)0x7F) // 0 to 100
#define FIT_ACTIVITY_CLASS_LEVEL_MAX                                             ((FIT_ACTIVITY_CLASS)100)
#define FIT_ACTIVITY_CLASS_ATHLETE                                               ((FIT_ACTIVITY_CLASS)0x80)
#define FIT_ACTIVITY_CLASS_COUNT                                                 3

typedef FIT_ENUM FIT_HR_ZONE_CALC;
#define FIT_HR_ZONE_CALC_INVALID                                                 FIT_ENUM_INVALID
#define FIT_HR_ZONE_CALC_CUSTOM                                                  ((FIT_HR_ZONE_CALC)0)
#define FIT_HR_ZONE_CALC_PERCENT_MAX_HR                                          ((FIT_HR_ZONE_CALC)1)
#define FIT_HR_ZONE_CALC_PERCENT_HRR                                             ((FIT_HR_ZONE_CALC)2)
#define FIT_HR_ZONE_CALC_COUNT                                                   3

typedef FIT_ENUM FIT_PWR_ZONE_CALC;
#define FIT_PWR_ZONE_CALC_INVALID                                                FIT_ENUM_INVALID
#define FIT_PWR_ZONE_CALC_CUSTOM                                                 ((FIT_PWR_ZONE_CALC)0)
#define FIT_PWR_ZONE_CALC_PERCENT_FTP                                            ((FIT_PWR_ZONE_CALC)1)
#define FIT_PWR_ZONE_CALC_COUNT                                                  2

typedef FIT_ENUM FIT_WKT_STEP_DURATION;
#define FIT_WKT_STEP_DURATION_INVALID                                            FIT_ENUM_INVALID
#define FIT_WKT_STEP_DURATION_TIME                                               ((FIT_WKT_STEP_DURATION)0)
#define FIT_WKT_STEP_DURATION_DISTANCE                                           ((FIT_WKT_STEP_DURATION)1)
#define FIT_WKT_STEP_DURATION_HR_LESS_THAN                                       ((FIT_WKT_STEP_DURATION)2)
#define FIT_WKT_STEP_DURATION_HR_GREATER_THAN                                    ((FIT_WKT_STEP_DURATION)3)
#define FIT_WKT_STEP_DURATION_CALORIES                                           ((FIT_WKT_STEP_DURATION)4)
#define FIT_WKT_STEP_DURATION_OPEN                                               ((FIT_WKT_STEP_DURATION)5)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_STEPS_CMPLT                           ((FIT_WKT_STEP_DURATION)6)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_TIME                                  ((FIT_WKT_STEP_DURATION)7)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_DISTANCE                              ((FIT_WKT_STEP_DURATION)8)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_CALORIES                              ((FIT_WKT_STEP_DURATION)9)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_HR_LESS_THAN                          ((FIT_WKT_STEP_DURATION)10)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_HR_GREATER_THAN                       ((FIT_WKT_STEP_DURATION)11)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_POWER_LESS_THAN                       ((FIT_WKT_STEP_DURATION)12)
#define FIT_WKT_STEP_DURATION_REPEAT_UNTIL_POWER_GREATER_THAN                    ((FIT_WKT_STEP_DURATION)13)
#define FIT_WKT_STEP_DURATION_POWER_LESS_THAN                                    ((FIT_WKT_STEP_DURATION)14)
#define FIT_WKT_STEP_DURATION_POWER_GREATER_THAN                                 ((FIT_WKT_STEP_DURATION)15)
#define FIT_WKT_STEP_DURATION_COUNT                                              16

typedef FIT_ENUM FIT_WKT_STEP_TARGET;
#define FIT_WKT_STEP_TARGET_INVALID                                              FIT_ENUM_INVALID
#define FIT_WKT_STEP_TARGET_SPEED                                                ((FIT_WKT_STEP_TARGET)0)
#define FIT_WKT_STEP_TARGET_HEART_RATE                                           ((FIT_WKT_STEP_TARGET)1)
#define FIT_WKT_STEP_TARGET_OPEN                                                 ((FIT_WKT_STEP_TARGET)2)
#define FIT_WKT_STEP_TARGET_CADENCE                                              ((FIT_WKT_STEP_TARGET)3)
#define FIT_WKT_STEP_TARGET_POWER                                                ((FIT_WKT_STEP_TARGET)4)
#define FIT_WKT_STEP_TARGET_GRADE                                                ((FIT_WKT_STEP_TARGET)5)
#define FIT_WKT_STEP_TARGET_RESISTANCE                                           ((FIT_WKT_STEP_TARGET)6)
#define FIT_WKT_STEP_TARGET_COUNT                                                7

typedef FIT_ENUM FIT_GOAL;
#define FIT_GOAL_INVALID                                                         FIT_ENUM_INVALID
#define FIT_GOAL_TIME                                                            ((FIT_GOAL)0)
#define FIT_GOAL_DISTANCE                                                        ((FIT_GOAL)1)
#define FIT_GOAL_CALORIES                                                        ((FIT_GOAL)2)
#define FIT_GOAL_FREQUENCY                                                       ((FIT_GOAL)3)
#define FIT_GOAL_STEPS                                                           ((FIT_GOAL)4)
#define FIT_GOAL_COUNT                                                           5

typedef FIT_ENUM FIT_GOAL_RECURRENCE;
#define FIT_GOAL_RECURRENCE_INVALID                                              FIT_ENUM_INVALID
#define FIT_GOAL_RECURRENCE_OFF                                                  ((FIT_GOAL_RECURRENCE)0)
#define FIT_GOAL_RECURRENCE_DAILY                                                ((FIT_GOAL_RECURRENCE)1)
#define FIT_GOAL_RECURRENCE_WEEKLY                                               ((FIT_GOAL_RECURRENCE)2)
#define FIT_GOAL_RECURRENCE_MONTHLY                                              ((FIT_GOAL_RECURRENCE)3)
#define FIT_GOAL_RECURRENCE_YEARLY                                               ((FIT_GOAL_RECURRENCE)4)
#define FIT_GOAL_RECURRENCE_CUSTOM                                               ((FIT_GOAL_RECURRENCE)5)
#define FIT_GOAL_RECURRENCE_COUNT                                                6

typedef FIT_ENUM FIT_COURSE_POINT;
#define FIT_COURSE_POINT_INVALID                                                 FIT_ENUM_INVALID
#define FIT_COURSE_POINT_GENERIC                                                 ((FIT_COURSE_POINT)0)
#define FIT_COURSE_POINT_SUMMIT                                                  ((FIT_COURSE_POINT)1)
#define FIT_COURSE_POINT_VALLEY                                                  ((FIT_COURSE_POINT)2)
#define FIT_COURSE_POINT_WATER                                                   ((FIT_COURSE_POINT)3)
#define FIT_COURSE_POINT_FOOD                                                    ((FIT_COURSE_POINT)4)
#define FIT_COURSE_POINT_DANGER                                                  ((FIT_COURSE_POINT)5)
#define FIT_COURSE_POINT_LEFT                                                    ((FIT_COURSE_POINT)6)
#define FIT_COURSE_POINT_RIGHT                                                   ((FIT_COURSE_POINT)7)
#define FIT_COURSE_POINT_STRAIGHT                                                ((FIT_COURSE_POINT)8)
#define FIT_COURSE_POINT_FIRST_AID                                               ((FIT_COURSE_POINT)9)
#define FIT_COURSE_POINT_FOURTH_CATEGORY                                         ((FIT_COURSE_POINT)10)
#define FIT_COURSE_POINT_THIRD_CATEGORY                                          ((FIT_COURSE_POINT)11)
#define FIT_COURSE_POINT_SECOND_CATEGORY                                         ((FIT_COURSE_POINT)12)
#define FIT_COURSE_POINT_FIRST_CATEGORY                                          ((FIT_COURSE_POINT)13)
#define FIT_COURSE_POINT_HORS_CATEGORY                                           ((FIT_COURSE_POINT)14)
#define FIT_COURSE_POINT_SPRINT                                                  ((FIT_COURSE_POINT)15)
#define FIT_COURSE_POINT_LEFT_FORK                                               ((FIT_COURSE_POINT)16)
#define FIT_COURSE_POINT_RIGHT_FORK                                              ((FIT_COURSE_POINT)17)
#define FIT_COURSE_POINT_MIDDLE_FORK                                             ((FIT_COURSE_POINT)18)
#define FIT_COURSE_POINT_COUNT                                                   19

typedef FIT_UINT16 FIT_MANUFACTURER;
#define FIT_MANUFACTURER_INVALID                                                 FIT_UINT16_INVALID
#define FIT_MANUFACTURER_GARMIN                                                  ((FIT_MANUFACTURER)1)
#define FIT_MANUFACTURER_GARMIN_FR405_ANTFS                                      ((FIT_MANUFACTURER)2) // Do not use.  Used by FR405 for ANTFS man id.
#define FIT_MANUFACTURER_ZEPHYR                                                  ((FIT_MANUFACTURER)3)
#define FIT_MANUFACTURER_DAYTON                                                  ((FIT_MANUFACTURER)4)
#define FIT_MANUFACTURER_IDT                                                     ((FIT_MANUFACTURER)5)
#define FIT_MANUFACTURER_SRM                                                     ((FIT_MANUFACTURER)6)
#define FIT_MANUFACTURER_QUARQ                                                   ((FIT_MANUFACTURER)7)
#define FIT_MANUFACTURER_IBIKE                                                   ((FIT_MANUFACTURER)8)
#define FIT_MANUFACTURER_SARIS                                                   ((FIT_MANUFACTURER)9)
#define FIT_MANUFACTURER_SPARK_HK                                                ((FIT_MANUFACTURER)10)
#define FIT_MANUFACTURER_TANITA                                                  ((FIT_MANUFACTURER)11)
#define FIT_MANUFACTURER_ECHOWELL                                                ((FIT_MANUFACTURER)12)
#define FIT_MANUFACTURER_DYNASTREAM_OEM                                          ((FIT_MANUFACTURER)13)
#define FIT_MANUFACTURER_NAUTILUS                                                ((FIT_MANUFACTURER)14)
#define FIT_MANUFACTURER_DYNASTREAM                                              ((FIT_MANUFACTURER)15)
#define FIT_MANUFACTURER_TIMEX                                                   ((FIT_MANUFACTURER)16)
#define FIT_MANUFACTURER_METRIGEAR                                               ((FIT_MANUFACTURER)17)
#define FIT_MANUFACTURER_XELIC                                                   ((FIT_MANUFACTURER)18)
#define FIT_MANUFACTURER_BEURER                                                  ((FIT_MANUFACTURER)19)
#define FIT_MANUFACTURER_CARDIOSPORT                                             ((FIT_MANUFACTURER)20)
#define FIT_MANUFACTURER_A_AND_D                                                 ((FIT_MANUFACTURER)21)
#define FIT_MANUFACTURER_HMM                                                     ((FIT_MANUFACTURER)22)
#define FIT_MANUFACTURER_SUUNTO                                                  ((FIT_MANUFACTURER)23)
#define FIT_MANUFACTURER_THITA_ELEKTRONIK                                        ((FIT_MANUFACTURER)24)
#define FIT_MANUFACTURER_GPULSE                                                  ((FIT_MANUFACTURER)25)
#define FIT_MANUFACTURER_CLEAN_MOBILE                                            ((FIT_MANUFACTURER)26)
#define FIT_MANUFACTURER_PEDAL_BRAIN                                             ((FIT_MANUFACTURER)27)
#define FIT_MANUFACTURER_PEAKSWARE                                               ((FIT_MANUFACTURER)28)
#define FIT_MANUFACTURER_SAXONAR                                                 ((FIT_MANUFACTURER)29)
#define FIT_MANUFACTURER_LEMOND_FITNESS                                          ((FIT_MANUFACTURER)30)
#define FIT_MANUFACTURER_DEXCOM                                                  ((FIT_MANUFACTURER)31)
#define FIT_MANUFACTURER_WAHOO_FITNESS                                           ((FIT_MANUFACTURER)32)
#define FIT_MANUFACTURER_OCTANE_FITNESS                                          ((FIT_MANUFACTURER)33)
#define FIT_MANUFACTURER_ARCHINOETICS                                            ((FIT_MANUFACTURER)34)
#define FIT_MANUFACTURER_THE_HURT_BOX                                            ((FIT_MANUFACTURER)35)
#define FIT_MANUFACTURER_CITIZEN_SYSTEMS                                         ((FIT_MANUFACTURER)36)
#define FIT_MANUFACTURER_OSYNCE                                                  ((FIT_MANUFACTURER)38)
#define FIT_MANUFACTURER_HOLUX                                                   ((FIT_MANUFACTURER)39)
#define FIT_MANUFACTURER_CONCEPT2                                                ((FIT_MANUFACTURER)40)
#define FIT_MANUFACTURER_ONE_GIANT_LEAP                                          ((FIT_MANUFACTURER)42)
#define FIT_MANUFACTURER_ACE_SENSOR                                              ((FIT_MANUFACTURER)43)
#define FIT_MANUFACTURER_BRIM_BROTHERS                                           ((FIT_MANUFACTURER)44)
#define FIT_MANUFACTURER_XPLOVA                                                  ((FIT_MANUFACTURER)45)
#define FIT_MANUFACTURER_PERCEPTION_DIGITAL                                      ((FIT_MANUFACTURER)46)
#define FIT_MANUFACTURER_BF1SYSTEMS                                              ((FIT_MANUFACTURER)47)
#define FIT_MANUFACTURER_PIONEER                                                 ((FIT_MANUFACTURER)48)
#define FIT_MANUFACTURER_COUNT                                                   46

typedef FIT_UINT16 FIT_GARMIN_PRODUCT;
#define FIT_GARMIN_PRODUCT_INVALID                                               FIT_UINT16_INVALID
#define FIT_GARMIN_PRODUCT_HRM1                                                  ((FIT_GARMIN_PRODUCT)1)
#define FIT_GARMIN_PRODUCT_AXH01                                                 ((FIT_GARMIN_PRODUCT)2) // AXH01 HRM chipset
#define FIT_GARMIN_PRODUCT_AXB01                                                 ((FIT_GARMIN_PRODUCT)3)
#define FIT_GARMIN_PRODUCT_AXB02                                                 ((FIT_GARMIN_PRODUCT)4)
#define FIT_GARMIN_PRODUCT_HRM2SS                                                ((FIT_GARMIN_PRODUCT)5)
#define FIT_GARMIN_PRODUCT_DSI_ALF02                                             ((FIT_GARMIN_PRODUCT)6)
#define FIT_GARMIN_PRODUCT_FR405                                                 ((FIT_GARMIN_PRODUCT)717) // Forerunner 405
#define FIT_GARMIN_PRODUCT_FR50                                                  ((FIT_GARMIN_PRODUCT)782) // Forerunner 50
#define FIT_GARMIN_PRODUCT_FR60                                                  ((FIT_GARMIN_PRODUCT)988) // Forerunner 60
#define FIT_GARMIN_PRODUCT_DSI_ALF01                                             ((FIT_GARMIN_PRODUCT)1011)
#define FIT_GARMIN_PRODUCT_FR310XT                                               ((FIT_GARMIN_PRODUCT)1018) // Forerunner 310
#define FIT_GARMIN_PRODUCT_EDGE500                                               ((FIT_GARMIN_PRODUCT)1036)
#define FIT_GARMIN_PRODUCT_FR110                                                 ((FIT_GARMIN_PRODUCT)1124) // Forerunner 110
#define FIT_GARMIN_PRODUCT_EDGE800                                               ((FIT_GARMIN_PRODUCT)1169)
#define FIT_GARMIN_PRODUCT_CHIRP                                                 ((FIT_GARMIN_PRODUCT)1253)
#define FIT_GARMIN_PRODUCT_EDGE200                                               ((FIT_GARMIN_PRODUCT)1325)
#define FIT_GARMIN_PRODUCT_FR910XT                                               ((FIT_GARMIN_PRODUCT)1328)
#define FIT_GARMIN_PRODUCT_ALF04                                                 ((FIT_GARMIN_PRODUCT)1341)
#define FIT_GARMIN_PRODUCT_FR610                                                 ((FIT_GARMIN_PRODUCT)1345)
#define FIT_GARMIN_PRODUCT_FR70                                                  ((FIT_GARMIN_PRODUCT)1436)
#define FIT_GARMIN_PRODUCT_FR310XT_4T                                            ((FIT_GARMIN_PRODUCT)1446)
#define FIT_GARMIN_PRODUCT_SDM4                                                  ((FIT_GARMIN_PRODUCT)10007) // SDM4 footpod
#define FIT_GARMIN_PRODUCT_TRAINING_CENTER                                       ((FIT_GARMIN_PRODUCT)20119)
#define FIT_GARMIN_PRODUCT_CONNECT                                               ((FIT_GARMIN_PRODUCT)65534) // Garmin Connect website
#define FIT_GARMIN_PRODUCT_COUNT                                                 24

typedef FIT_UINT8 FIT_DEVICE_TYPE;
#define FIT_DEVICE_TYPE_INVALID                                                  FIT_UINT8_INVALID
#define FIT_DEVICE_TYPE_ANTFS                                                    ((FIT_DEVICE_TYPE)1)
#define FIT_DEVICE_TYPE_BIKE_POWER                                               ((FIT_DEVICE_TYPE)11)
#define FIT_DEVICE_TYPE_ENVIRONMENT_SENSOR                                       ((FIT_DEVICE_TYPE)12)
#define FIT_DEVICE_TYPE_MULTI_SPORT_SPEED_DISTANCE                               ((FIT_DEVICE_TYPE)15)
#define FIT_DEVICE_TYPE_FITNESS_EQUIPMENT                                        ((FIT_DEVICE_TYPE)17)
#define FIT_DEVICE_TYPE_BLOOD_PRESSURE                                           ((FIT_DEVICE_TYPE)18)
#define FIT_DEVICE_TYPE_WEIGHT_SCALE                                             ((FIT_DEVICE_TYPE)119)
#define FIT_DEVICE_TYPE_HEART_RATE                                               ((FIT_DEVICE_TYPE)120)
#define FIT_DEVICE_TYPE_BIKE_SPEED_CADENCE                                       ((FIT_DEVICE_TYPE)121)
#define FIT_DEVICE_TYPE_BIKE_CADENCE                                             ((FIT_DEVICE_TYPE)122)
#define FIT_DEVICE_TYPE_BIKE_SPEED                                               ((FIT_DEVICE_TYPE)123)
#define FIT_DEVICE_TYPE_STRIDE_SPEED_DISTANCE                                    ((FIT_DEVICE_TYPE)124)
#define FIT_DEVICE_TYPE_COUNT                                                    12

typedef FIT_UINT32Z FIT_WORKOUT_CAPABILITIES;
#define FIT_WORKOUT_CAPABILITIES_INVALID                                         FIT_UINT32Z_INVALID
#define FIT_WORKOUT_CAPABILITIES_INTERVAL                                        ((FIT_WORKOUT_CAPABILITIES)0x00000001)
#define FIT_WORKOUT_CAPABILITIES_CUSTOM                                          ((FIT_WORKOUT_CAPABILITIES)0x00000002)
#define FIT_WORKOUT_CAPABILITIES_FITNESS_EQUIPMENT                               ((FIT_WORKOUT_CAPABILITIES)0x00000004)
#define FIT_WORKOUT_CAPABILITIES_FIRSTBEAT                                       ((FIT_WORKOUT_CAPABILITIES)0x00000008)
#define FIT_WORKOUT_CAPABILITIES_NEW_LEAF                                        ((FIT_WORKOUT_CAPABILITIES)0x00000010)
#define FIT_WORKOUT_CAPABILITIES_TCX                                             ((FIT_WORKOUT_CAPABILITIES)0x00000020) // For backwards compatibility.  Watch should add missing id fields then clear flag.
#define FIT_WORKOUT_CAPABILITIES_SPEED                                           ((FIT_WORKOUT_CAPABILITIES)0x00000080) // Speed source required for workout step.
#define FIT_WORKOUT_CAPABILITIES_HEART_RATE                                      ((FIT_WORKOUT_CAPABILITIES)0x00000100) // Heart rate source required for workout step.
#define FIT_WORKOUT_CAPABILITIES_DISTANCE                                        ((FIT_WORKOUT_CAPABILITIES)0x00000200) // Distance source required for workout step.
#define FIT_WORKOUT_CAPABILITIES_CADENCE                                         ((FIT_WORKOUT_CAPABILITIES)0x00000400) // Cadence source required for workout step.
#define FIT_WORKOUT_CAPABILITIES_POWER                                           ((FIT_WORKOUT_CAPABILITIES)0x00000800) // Power source required for workout step.
#define FIT_WORKOUT_CAPABILITIES_GRADE                                           ((FIT_WORKOUT_CAPABILITIES)0x00001000) // Grade source required for workout step.
#define FIT_WORKOUT_CAPABILITIES_RESISTANCE                                      ((FIT_WORKOUT_CAPABILITIES)0x00002000) // Resistance source required for workout step.
#define FIT_WORKOUT_CAPABILITIES_PROTECTED                                       ((FIT_WORKOUT_CAPABILITIES)0x00004000)
#define FIT_WORKOUT_CAPABILITIES_COUNT                                           14

typedef FIT_UINT8 FIT_BATTERY_STATUS;
#define FIT_BATTERY_STATUS_INVALID                                               FIT_UINT8_INVALID
#define FIT_BATTERY_STATUS_NEW                                                   ((FIT_BATTERY_STATUS)1)
#define FIT_BATTERY_STATUS_GOOD                                                  ((FIT_BATTERY_STATUS)2)
#define FIT_BATTERY_STATUS_OK                                                    ((FIT_BATTERY_STATUS)3)
#define FIT_BATTERY_STATUS_LOW                                                   ((FIT_BATTERY_STATUS)4)
#define FIT_BATTERY_STATUS_CRITICAL                                              ((FIT_BATTERY_STATUS)5)
#define FIT_BATTERY_STATUS_COUNT                                                 5

typedef FIT_ENUM FIT_HR_TYPE;
#define FIT_HR_TYPE_INVALID                                                      FIT_ENUM_INVALID
#define FIT_HR_TYPE_NORMAL                                                       ((FIT_HR_TYPE)0)
#define FIT_HR_TYPE_IRREGULAR                                                    ((FIT_HR_TYPE)1)
#define FIT_HR_TYPE_COUNT                                                        2

typedef FIT_UINT32Z FIT_COURSE_CAPABILITIES;
#define FIT_COURSE_CAPABILITIES_INVALID                                          FIT_UINT32Z_INVALID
#define FIT_COURSE_CAPABILITIES_PROCESSED                                        ((FIT_COURSE_CAPABILITIES)0x00000001)
#define FIT_COURSE_CAPABILITIES_VALID                                            ((FIT_COURSE_CAPABILITIES)0x00000002)
#define FIT_COURSE_CAPABILITIES_TIME                                             ((FIT_COURSE_CAPABILITIES)0x00000004)
#define FIT_COURSE_CAPABILITIES_DISTANCE                                         ((FIT_COURSE_CAPABILITIES)0x00000008)
#define FIT_COURSE_CAPABILITIES_POSITION                                         ((FIT_COURSE_CAPABILITIES)0x00000010)
#define FIT_COURSE_CAPABILITIES_HEART_RATE                                       ((FIT_COURSE_CAPABILITIES)0x00000020)
#define FIT_COURSE_CAPABILITIES_POWER                                            ((FIT_COURSE_CAPABILITIES)0x00000040)
#define FIT_COURSE_CAPABILITIES_CADENCE                                          ((FIT_COURSE_CAPABILITIES)0x00000080)
#define FIT_COURSE_CAPABILITIES_TRAINING                                         ((FIT_COURSE_CAPABILITIES)0x00000100)
#define FIT_COURSE_CAPABILITIES_NAVIGATION                                       ((FIT_COURSE_CAPABILITIES)0x00000200)
#define FIT_COURSE_CAPABILITIES_COUNT                                            10

typedef FIT_UINT16 FIT_WEIGHT;
#define FIT_WEIGHT_INVALID                                                       FIT_UINT16_INVALID
#define FIT_WEIGHT_CALCULATING                                                   ((FIT_WEIGHT)0xFFFE)
#define FIT_WEIGHT_COUNT                                                         1

typedef FIT_UINT32 FIT_WORKOUT_HR; // 0 - 100 indicates% of maz hr; >100 indicates bpm (255 max) plus 100
#define FIT_WORKOUT_HR_INVALID                                                   FIT_UINT32_INVALID
#define FIT_WORKOUT_HR_BPM_OFFSET                                                ((FIT_WORKOUT_HR)100)
#define FIT_WORKOUT_HR_COUNT                                                     1

typedef FIT_UINT32 FIT_WORKOUT_POWER; // 0 - 1000 indicates % of functional threshold power; >1000 indicates watts plus 1000.
#define FIT_WORKOUT_POWER_INVALID                                                FIT_UINT32_INVALID
#define FIT_WORKOUT_POWER_WATTS_OFFSET                                           ((FIT_WORKOUT_POWER)1000)
#define FIT_WORKOUT_POWER_COUNT                                                  1

typedef FIT_ENUM FIT_BP_STATUS;
#define FIT_BP_STATUS_INVALID                                                    FIT_ENUM_INVALID
#define FIT_BP_STATUS_NO_ERROR                                                   ((FIT_BP_STATUS)0)
#define FIT_BP_STATUS_ERROR_INCOMPLETE_DATA                                      ((FIT_BP_STATUS)1)
#define FIT_BP_STATUS_ERROR_NO_MEASUREMENT                                       ((FIT_BP_STATUS)2)
#define FIT_BP_STATUS_ERROR_DATA_OUT_OF_RANGE                                    ((FIT_BP_STATUS)3)
#define FIT_BP_STATUS_ERROR_IRREGULAR_HEART_RATE                                 ((FIT_BP_STATUS)4)
#define FIT_BP_STATUS_COUNT                                                      5

typedef FIT_UINT16 FIT_USER_LOCAL_ID;
#define FIT_USER_LOCAL_ID_INVALID                                                FIT_UINT16_INVALID
#define FIT_USER_LOCAL_ID_LOCAL_MIN                                              ((FIT_USER_LOCAL_ID)0x0001)
#define FIT_USER_LOCAL_ID_LOCAL_MAX                                              ((FIT_USER_LOCAL_ID)0x000F)
#define FIT_USER_LOCAL_ID_STATIONARY_MIN                                         ((FIT_USER_LOCAL_ID)0x0010)
#define FIT_USER_LOCAL_ID_STATIONARY_MAX                                         ((FIT_USER_LOCAL_ID)0x00FF)
#define FIT_USER_LOCAL_ID_PORTABLE_MIN                                           ((FIT_USER_LOCAL_ID)0x0100)
#define FIT_USER_LOCAL_ID_PORTABLE_MAX                                           ((FIT_USER_LOCAL_ID)0xFFFE)
#define FIT_USER_LOCAL_ID_COUNT                                                  6

typedef FIT_UINT8 FIT_LEFT_RIGHT_BALANCE;
#define FIT_LEFT_RIGHT_BALANCE_INVALID                                           FIT_UINT8_INVALID
#define FIT_LEFT_RIGHT_BALANCE_MASK                                              ((FIT_LEFT_RIGHT_BALANCE)0x7F) // % contribution
#define FIT_LEFT_RIGHT_BALANCE_RIGHT                                             ((FIT_LEFT_RIGHT_BALANCE)0x80) // data corresponds to right if set, otherwise unknown
#define FIT_LEFT_RIGHT_BALANCE_COUNT                                             2

typedef FIT_UINT16 FIT_LEFT_RIGHT_BALANCE_100;
#define FIT_LEFT_RIGHT_BALANCE_100_INVALID                                       FIT_UINT16_INVALID
#define FIT_LEFT_RIGHT_BALANCE_100_MASK                                          ((FIT_LEFT_RIGHT_BALANCE_100)0x3FFF) // % contribution scaled by 100
#define FIT_LEFT_RIGHT_BALANCE_100_RIGHT                                         ((FIT_LEFT_RIGHT_BALANCE_100)0x8000) // data corresponds to right if set, otherwise unknown
#define FIT_LEFT_RIGHT_BALANCE_100_COUNT                                         2

typedef FIT_UINT8 FIT_CRANK_LENGTH;
#define FIT_CRANK_LENGTH_INVALID                                                 FIT_UINT8_INVALID
#define FIT_CRANK_LENGTH_AUTO                                                    ((FIT_CRANK_LENGTH)0xFE)
#define FIT_CRANK_LENGTH_COUNT                                                   1


#endif // !defined(FIT_CPP_INCLUDE_C)

///////////////////////////////////////////////////////////////////////
// Miscellaneous
///////////////////////////////////////////////////////////////////////

#define FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD                                       (FIT_UINT16_INVALID - 1)
#define FIT_SUBFIELD_INDEX_MAIN_FIELD                                            (FIT_UINT16_INVALID)


namespace fit
{

class Profile
{
   public:
      typedef enum
      {
         MESG_FILE_ID,
         MESG_FILE_CREATOR,
         MESG_PAD,
         MESG_SOFTWARE,
         MESG_CAPABILITIES,
         MESG_FILE_CAPABILITIES,
         MESG_MESG_CAPABILITIES,
         MESG_FIELD_CAPABILITIES,
         MESG_DEVICE_SETTINGS,
         MESG_USER_PROFILE,
         MESG_HRM_PROFILE,
         MESG_SDM_PROFILE,
         MESG_BIKE_PROFILE,
         MESG_ZONES_TARGET,
         MESG_SPORT,
         MESG_HR_ZONE,
         MESG_POWER_ZONE,
         MESG_MET_ZONE,
         MESG_GOAL,
         MESG_ACTIVITY,
         MESG_SESSION,
         MESG_LAP,
         MESG_RECORD,
         MESG_EVENT,
         MESG_DEVICE_INFO,
         MESG_HRV,
         MESG_COURSE,
         MESG_COURSE_POINT,
         MESG_WORKOUT,
         MESG_WORKOUT_STEP,
         MESG_TOTALS,
         MESG_WEIGHT_SCALE,
         MESG_BLOOD_PRESSURE,
         MESGS
      } MESG_INDEX;

      typedef enum
      {
         FILE_ID_MESG_TYPE,
         FILE_ID_MESG_MANUFACTURER,
         FILE_ID_MESG_PRODUCT,
         FILE_ID_MESG_SERIAL_NUMBER,
         FILE_ID_MESG_TIME_CREATED,
         FILE_ID_MESG_NUMBER,
         FILE_ID_MESG_CHECKSUM,
         FILE_ID_MESG_FIELDS
      } FILE_ID_MESG_FIELD_INDEX;

      typedef enum
      {
         FILE_ID_MESG_PRODUCT_FIELD_GARMIN_PRODUCT,
         FILE_ID_MESG_PRODUCT_FIELD_SUBFIELDS,
         FILE_ID_MESG_PRODUCT_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         FILE_ID_MESG_PRODUCT_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } FILE_ID_MESG_PRODUCT_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         FILE_CREATOR_MESG_SOFTWARE_VERSION,
         FILE_CREATOR_MESG_HARDWARE_VERSION,
         FILE_CREATOR_MESG_CHECKSUM,
         FILE_CREATOR_MESG_FIELDS
      } FILE_CREATOR_MESG_FIELD_INDEX;

      typedef enum
      {
         PAD_MESG_PAD,
         PAD_MESG_CHECKSUM,
         PAD_MESG_FIELDS
      } PAD_MESG_FIELD_INDEX;

      typedef enum
      {
         SOFTWARE_MESG_MESSAGE_INDEX,
         SOFTWARE_MESG_VERSION,
         SOFTWARE_MESG_PART_NUMBER,
         SOFTWARE_MESG_CHECKSUM,
         SOFTWARE_MESG_FIELDS
      } SOFTWARE_MESG_FIELD_INDEX;

      typedef enum
      {
         CAPABILITIES_MESG_LANGUAGES,
         CAPABILITIES_MESG_SPORTS,
         CAPABILITIES_MESG_WORKOUTS_SUPPORTED,
         CAPABILITIES_MESG_CHECKSUM,
         CAPABILITIES_MESG_FIELDS
      } CAPABILITIES_MESG_FIELD_INDEX;

      typedef enum
      {
         FILE_CAPABILITIES_MESG_MESSAGE_INDEX,
         FILE_CAPABILITIES_MESG_TYPE,
         FILE_CAPABILITIES_MESG_FLAGS,
         FILE_CAPABILITIES_MESG_DIRECTORY,
         FILE_CAPABILITIES_MESG_MAX_COUNT,
         FILE_CAPABILITIES_MESG_MAX_SIZE,
         FILE_CAPABILITIES_MESG_CHECKSUM,
         FILE_CAPABILITIES_MESG_FIELDS
      } FILE_CAPABILITIES_MESG_FIELD_INDEX;

      typedef enum
      {
         MESG_CAPABILITIES_MESG_MESSAGE_INDEX,
         MESG_CAPABILITIES_MESG_FILE,
         MESG_CAPABILITIES_MESG_MESG_NUM,
         MESG_CAPABILITIES_MESG_COUNT_TYPE,
         MESG_CAPABILITIES_MESG_COUNT,
         MESG_CAPABILITIES_MESG_CHECKSUM,
         MESG_CAPABILITIES_MESG_FIELDS
      } MESG_CAPABILITIES_MESG_FIELD_INDEX;

      typedef enum
      {
         MESG_CAPABILITIES_MESG_COUNT_FIELD_NUM_PER_FILE,
         MESG_CAPABILITIES_MESG_COUNT_FIELD_MAX_PER_FILE,
         MESG_CAPABILITIES_MESG_COUNT_FIELD_MAX_PER_FILE_TYPE,
         MESG_CAPABILITIES_MESG_COUNT_FIELD_SUBFIELDS,
         MESG_CAPABILITIES_MESG_COUNT_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         MESG_CAPABILITIES_MESG_COUNT_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } MESG_CAPABILITIES_MESG_COUNT_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         FIELD_CAPABILITIES_MESG_MESSAGE_INDEX,
         FIELD_CAPABILITIES_MESG_FILE,
         FIELD_CAPABILITIES_MESG_MESG_NUM,
         FIELD_CAPABILITIES_MESG_FIELD_NUM,
         FIELD_CAPABILITIES_MESG_COUNT,
         FIELD_CAPABILITIES_MESG_CHECKSUM,
         FIELD_CAPABILITIES_MESG_FIELDS
      } FIELD_CAPABILITIES_MESG_FIELD_INDEX;

      typedef enum
      {
         DEVICE_SETTINGS_MESG_UTC_OFFSET,
         DEVICE_SETTINGS_MESG_CHECKSUM,
         DEVICE_SETTINGS_MESG_FIELDS
      } DEVICE_SETTINGS_MESG_FIELD_INDEX;

      typedef enum
      {
         USER_PROFILE_MESG_MESSAGE_INDEX,
         USER_PROFILE_MESG_FRIENDLY_NAME,
         USER_PROFILE_MESG_GENDER,
         USER_PROFILE_MESG_AGE,
         USER_PROFILE_MESG_HEIGHT,
         USER_PROFILE_MESG_WEIGHT,
         USER_PROFILE_MESG_LANGUAGE,
         USER_PROFILE_MESG_ELEV_SETTING,
         USER_PROFILE_MESG_WEIGHT_SETTING,
         USER_PROFILE_MESG_RESTING_HEART_RATE,
         USER_PROFILE_MESG_DEFAULT_MAX_RUNNING_HEART_RATE,
         USER_PROFILE_MESG_DEFAULT_MAX_BIKING_HEART_RATE,
         USER_PROFILE_MESG_DEFAULT_MAX_HEART_RATE,
         USER_PROFILE_MESG_HR_SETTING,
         USER_PROFILE_MESG_SPEED_SETTING,
         USER_PROFILE_MESG_DIST_SETTING,
         USER_PROFILE_MESG_POWER_SETTING,
         USER_PROFILE_MESG_ACTIVITY_CLASS,
         USER_PROFILE_MESG_POSITION_SETTING,
         USER_PROFILE_MESG_TEMPERATURE_SETTING,
         USER_PROFILE_MESG_LOCAL_ID,
         USER_PROFILE_MESG_GLOBAL_ID,
         USER_PROFILE_MESG_CHECKSUM,
         USER_PROFILE_MESG_FIELDS
      } USER_PROFILE_MESG_FIELD_INDEX;

      typedef enum
      {
         HRM_PROFILE_MESG_MESSAGE_INDEX,
         HRM_PROFILE_MESG_ENABLED,
         HRM_PROFILE_MESG_HRM_ANT_ID,
         HRM_PROFILE_MESG_LOG_HRV,
         HRM_PROFILE_MESG_HRM_ANT_ID_TRANS_TYPE,
         HRM_PROFILE_MESG_CHECKSUM,
         HRM_PROFILE_MESG_FIELDS
      } HRM_PROFILE_MESG_FIELD_INDEX;

      typedef enum
      {
         SDM_PROFILE_MESG_MESSAGE_INDEX,
         SDM_PROFILE_MESG_ENABLED,
         SDM_PROFILE_MESG_SDM_ANT_ID,
         SDM_PROFILE_MESG_SDM_CAL_FACTOR,
         SDM_PROFILE_MESG_ODOMETER,
         SDM_PROFILE_MESG_SPEED_SOURCE,
         SDM_PROFILE_MESG_SDM_ANT_ID_TRANS_TYPE,
         SDM_PROFILE_MESG_CHECKSUM,
         SDM_PROFILE_MESG_FIELDS
      } SDM_PROFILE_MESG_FIELD_INDEX;

      typedef enum
      {
         BIKE_PROFILE_MESG_MESSAGE_INDEX,
         BIKE_PROFILE_MESG_NAME,
         BIKE_PROFILE_MESG_SPORT,
         BIKE_PROFILE_MESG_SUB_SPORT,
         BIKE_PROFILE_MESG_ODOMETER,
         BIKE_PROFILE_MESG_BIKE_SPD_ANT_ID,
         BIKE_PROFILE_MESG_BIKE_CAD_ANT_ID,
         BIKE_PROFILE_MESG_BIKE_SPDCAD_ANT_ID,
         BIKE_PROFILE_MESG_BIKE_POWER_ANT_ID,
         BIKE_PROFILE_MESG_CUSTOM_WHEELSIZE,
         BIKE_PROFILE_MESG_AUTO_WHEELSIZE,
         BIKE_PROFILE_MESG_BIKE_WEIGHT,
         BIKE_PROFILE_MESG_POWER_CAL_FACTOR,
         BIKE_PROFILE_MESG_AUTO_WHEEL_CAL,
         BIKE_PROFILE_MESG_AUTO_POWER_ZERO,
         BIKE_PROFILE_MESG_ID,
         BIKE_PROFILE_MESG_SPD_ENABLED,
         BIKE_PROFILE_MESG_CAD_ENABLED,
         BIKE_PROFILE_MESG_SPDCAD_ENABLED,
         BIKE_PROFILE_MESG_POWER_ENABLED,
         BIKE_PROFILE_MESG_CRANK_LENGTH,
         BIKE_PROFILE_MESG_ENABLED,
         BIKE_PROFILE_MESG_BIKE_SPD_ANT_ID_TRANS_TYPE,
         BIKE_PROFILE_MESG_BIKE_CAD_ANT_ID_TRANS_TYPE,
         BIKE_PROFILE_MESG_BIKE_SPDCAD_ANT_ID_TRANS_TYPE,
         BIKE_PROFILE_MESG_BIKE_POWER_ANT_ID_TRANS_TYPE,
         BIKE_PROFILE_MESG_CHECKSUM,
         BIKE_PROFILE_MESG_FIELDS
      } BIKE_PROFILE_MESG_FIELD_INDEX;

      typedef enum
      {
         ZONES_TARGET_MESG_MAX_HEART_RATE,
         ZONES_TARGET_MESG_THRESHOLD_HEART_RATE,
         ZONES_TARGET_MESG_FUNCTIONAL_THRESHOLD_POWER,
         ZONES_TARGET_MESG_HR_CALC_TYPE,
         ZONES_TARGET_MESG_PWR_CALC_TYPE,
         ZONES_TARGET_MESG_CHECKSUM,
         ZONES_TARGET_MESG_FIELDS
      } ZONES_TARGET_MESG_FIELD_INDEX;

      typedef enum
      {
         SPORT_MESG_SPORT,
         SPORT_MESG_SUB_SPORT,
         SPORT_MESG_NAME,
         SPORT_MESG_CHECKSUM,
         SPORT_MESG_FIELDS
      } SPORT_MESG_FIELD_INDEX;

      typedef enum
      {
         HR_ZONE_MESG_MESSAGE_INDEX,
         HR_ZONE_MESG_HIGH_BPM,
         HR_ZONE_MESG_NAME,
         HR_ZONE_MESG_CHECKSUM,
         HR_ZONE_MESG_FIELDS
      } HR_ZONE_MESG_FIELD_INDEX;

      typedef enum
      {
         POWER_ZONE_MESG_MESSAGE_INDEX,
         POWER_ZONE_MESG_HIGH_VALUE,
         POWER_ZONE_MESG_NAME,
         POWER_ZONE_MESG_CHECKSUM,
         POWER_ZONE_MESG_FIELDS
      } POWER_ZONE_MESG_FIELD_INDEX;

      typedef enum
      {
         MET_ZONE_MESG_MESSAGE_INDEX,
         MET_ZONE_MESG_HIGH_BPM,
         MET_ZONE_MESG_CALORIES,
         MET_ZONE_MESG_FAT_CALORIES,
         MET_ZONE_MESG_CHECKSUM,
         MET_ZONE_MESG_FIELDS
      } MET_ZONE_MESG_FIELD_INDEX;

      typedef enum
      {
         GOAL_MESG_MESSAGE_INDEX,
         GOAL_MESG_SPORT,
         GOAL_MESG_SUB_SPORT,
         GOAL_MESG_START_DATE,
         GOAL_MESG_END_DATE,
         GOAL_MESG_TYPE,
         GOAL_MESG_VALUE,
         GOAL_MESG_REPEAT,
         GOAL_MESG_TARGET_VALUE,
         GOAL_MESG_RECURRENCE,
         GOAL_MESG_RECURRENCE_VALUE,
         GOAL_MESG_ENABLED,
         GOAL_MESG_CHECKSUM,
         GOAL_MESG_FIELDS
      } GOAL_MESG_FIELD_INDEX;

      typedef enum
      {
         ACTIVITY_MESG_TIMESTAMP,
         ACTIVITY_MESG_TOTAL_TIMER_TIME,
         ACTIVITY_MESG_NUM_SESSIONS,
         ACTIVITY_MESG_TYPE,
         ACTIVITY_MESG_EVENT,
         ACTIVITY_MESG_EVENT_TYPE,
         ACTIVITY_MESG_LOCAL_TIMESTAMP,
         ACTIVITY_MESG_EVENT_GROUP,
         ACTIVITY_MESG_CHECKSUM,
         ACTIVITY_MESG_FIELDS
      } ACTIVITY_MESG_FIELD_INDEX;

      typedef enum
      {
         SESSION_MESG_MESSAGE_INDEX,
         SESSION_MESG_TIMESTAMP,
         SESSION_MESG_EVENT,
         SESSION_MESG_EVENT_TYPE,
         SESSION_MESG_START_TIME,
         SESSION_MESG_START_POSITION_LAT,
         SESSION_MESG_START_POSITION_LONG,
         SESSION_MESG_SPORT,
         SESSION_MESG_SUB_SPORT,
         SESSION_MESG_TOTAL_ELAPSED_TIME,
         SESSION_MESG_TOTAL_TIMER_TIME,
         SESSION_MESG_TOTAL_DISTANCE,
         SESSION_MESG_TOTAL_CYCLES,
         SESSION_MESG_TOTAL_CALORIES,
         SESSION_MESG_TOTAL_FAT_CALORIES,
         SESSION_MESG_AVG_SPEED,
         SESSION_MESG_MAX_SPEED,
         SESSION_MESG_AVG_HEART_RATE,
         SESSION_MESG_MAX_HEART_RATE,
         SESSION_MESG_AVG_CADENCE,
         SESSION_MESG_MAX_CADENCE,
         SESSION_MESG_AVG_POWER,
         SESSION_MESG_MAX_POWER,
         SESSION_MESG_TOTAL_ASCENT,
         SESSION_MESG_TOTAL_DESCENT,
         SESSION_MESG_TOTAL_TRAINING_EFFECT,
         SESSION_MESG_FIRST_LAP_INDEX,
         SESSION_MESG_NUM_LAPS,
         SESSION_MESG_EVENT_GROUP,
         SESSION_MESG_TRIGGER,
         SESSION_MESG_NEC_LAT,
         SESSION_MESG_NEC_LONG,
         SESSION_MESG_SWC_LAT,
         SESSION_MESG_SWC_LONG,
         SESSION_MESG_NORMALIZED_POWER,
         SESSION_MESG_TRAINING_STRESS_SCORE,
         SESSION_MESG_INTENSITY_FACTOR,
         SESSION_MESG_LEFT_RIGHT_BALANCE,
         SESSION_MESG_CHECKSUM,
         SESSION_MESG_FIELDS
      } SESSION_MESG_FIELD_INDEX;

      typedef enum
      {
         SESSION_MESG_TOTAL_CYCLES_FIELD_TOTAL_STRIDES,
         SESSION_MESG_TOTAL_CYCLES_FIELD_SUBFIELDS,
         SESSION_MESG_TOTAL_CYCLES_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         SESSION_MESG_TOTAL_CYCLES_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } SESSION_MESG_TOTAL_CYCLES_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         SESSION_MESG_AVG_CADENCE_FIELD_AVG_RUNNING_CADENCE,
         SESSION_MESG_AVG_CADENCE_FIELD_SUBFIELDS,
         SESSION_MESG_AVG_CADENCE_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         SESSION_MESG_AVG_CADENCE_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } SESSION_MESG_AVG_CADENCE_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         SESSION_MESG_MAX_CADENCE_FIELD_MAX_RUNNING_CADENCE,
         SESSION_MESG_MAX_CADENCE_FIELD_SUBFIELDS,
         SESSION_MESG_MAX_CADENCE_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         SESSION_MESG_MAX_CADENCE_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } SESSION_MESG_MAX_CADENCE_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         LAP_MESG_MESSAGE_INDEX,
         LAP_MESG_TIMESTAMP,
         LAP_MESG_EVENT,
         LAP_MESG_EVENT_TYPE,
         LAP_MESG_START_TIME,
         LAP_MESG_START_POSITION_LAT,
         LAP_MESG_START_POSITION_LONG,
         LAP_MESG_END_POSITION_LAT,
         LAP_MESG_END_POSITION_LONG,
         LAP_MESG_TOTAL_ELAPSED_TIME,
         LAP_MESG_TOTAL_TIMER_TIME,
         LAP_MESG_TOTAL_DISTANCE,
         LAP_MESG_TOTAL_CYCLES,
         LAP_MESG_TOTAL_CALORIES,
         LAP_MESG_TOTAL_FAT_CALORIES,
         LAP_MESG_AVG_SPEED,
         LAP_MESG_MAX_SPEED,
         LAP_MESG_AVG_HEART_RATE,
         LAP_MESG_MAX_HEART_RATE,
         LAP_MESG_AVG_CADENCE,
         LAP_MESG_MAX_CADENCE,
         LAP_MESG_AVG_POWER,
         LAP_MESG_MAX_POWER,
         LAP_MESG_TOTAL_ASCENT,
         LAP_MESG_TOTAL_DESCENT,
         LAP_MESG_INTENSITY,
         LAP_MESG_LAP_TRIGGER,
         LAP_MESG_SPORT,
         LAP_MESG_EVENT_GROUP,
         LAP_MESG_NORMALIZED_POWER,
         LAP_MESG_LEFT_RIGHT_BALANCE,
         LAP_MESG_CHECKSUM,
         LAP_MESG_FIELDS
      } LAP_MESG_FIELD_INDEX;

      typedef enum
      {
         LAP_MESG_TOTAL_CYCLES_FIELD_TOTAL_STRIDES,
         LAP_MESG_TOTAL_CYCLES_FIELD_SUBFIELDS,
         LAP_MESG_TOTAL_CYCLES_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         LAP_MESG_TOTAL_CYCLES_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } LAP_MESG_TOTAL_CYCLES_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         LAP_MESG_AVG_CADENCE_FIELD_AVG_RUNNING_CADENCE,
         LAP_MESG_AVG_CADENCE_FIELD_SUBFIELDS,
         LAP_MESG_AVG_CADENCE_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         LAP_MESG_AVG_CADENCE_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } LAP_MESG_AVG_CADENCE_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         LAP_MESG_MAX_CADENCE_FIELD_MAX_RUNNING_CADENCE,
         LAP_MESG_MAX_CADENCE_FIELD_SUBFIELDS,
         LAP_MESG_MAX_CADENCE_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         LAP_MESG_MAX_CADENCE_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } LAP_MESG_MAX_CADENCE_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         RECORD_MESG_TIMESTAMP,
         RECORD_MESG_POSITION_LAT,
         RECORD_MESG_POSITION_LONG,
         RECORD_MESG_ALTITUDE,
         RECORD_MESG_HEART_RATE,
         RECORD_MESG_CADENCE,
         RECORD_MESG_DISTANCE,
         RECORD_MESG_SPEED,
         RECORD_MESG_POWER,
         RECORD_MESG_COMPRESSED_SPEED_DISTANCE,
         RECORD_MESG_GRADE,
         RECORD_MESG_RESISTANCE,
         RECORD_MESG_TIME_FROM_COURSE,
         RECORD_MESG_CYCLE_LENGTH,
         RECORD_MESG_TEMPERATURE,
         RECORD_MESG_SPEED_1S,
         RECORD_MESG_CYCLES,
         RECORD_MESG_TOTAL_CYCLES,
         RECORD_MESG_COMPRESSED_ACCUMULATED_POWER,
         RECORD_MESG_ACCUMULATED_POWER,
         RECORD_MESG_LEFT_RIGHT_BALANCE,
         RECORD_MESG_CHECKSUM,
         RECORD_MESG_FIELDS
      } RECORD_MESG_FIELD_INDEX;

      typedef enum
      {
         EVENT_MESG_TIMESTAMP,
         EVENT_MESG_EVENT,
         EVENT_MESG_EVENT_TYPE,
         EVENT_MESG_DATA16,
         EVENT_MESG_DATA,
         EVENT_MESG_EVENT_GROUP,
         EVENT_MESG_CHECKSUM,
         EVENT_MESG_FIELDS
      } EVENT_MESG_FIELD_INDEX;

      typedef enum
      {
         EVENT_MESG_DATA_FIELD_TIMER_TRIGGER,
         EVENT_MESG_DATA_FIELD_COURSE_POINT_INDEX,
         EVENT_MESG_DATA_FIELD_BATTERY_LEVEL,
         EVENT_MESG_DATA_FIELD_VIRTUAL_PARTNER_SPEED,
         EVENT_MESG_DATA_FIELD_HR_HIGH_ALERT,
         EVENT_MESG_DATA_FIELD_HR_LOW_ALERT,
         EVENT_MESG_DATA_FIELD_SPEED_HIGH_ALERT,
         EVENT_MESG_DATA_FIELD_SPEED_LOW_ALERT,
         EVENT_MESG_DATA_FIELD_CAD_HIGH_ALERT,
         EVENT_MESG_DATA_FIELD_CAD_LOW_ALERT,
         EVENT_MESG_DATA_FIELD_POWER_HIGH_ALERT,
         EVENT_MESG_DATA_FIELD_POWER_LOW_ALERT,
         EVENT_MESG_DATA_FIELD_TIME_DURATION_ALERT,
         EVENT_MESG_DATA_FIELD_DISTANCE_DURATION_ALERT,
         EVENT_MESG_DATA_FIELD_CALORIE_DURATION_ALERT,
         EVENT_MESG_DATA_FIELD_FITNESS_EQUIPMENT_STATE,
         EVENT_MESG_DATA_FIELD_SUBFIELDS,
         EVENT_MESG_DATA_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         EVENT_MESG_DATA_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } EVENT_MESG_DATA_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         DEVICE_INFO_MESG_TIMESTAMP,
         DEVICE_INFO_MESG_DEVICE_INDEX,
         DEVICE_INFO_MESG_DEVICE_TYPE,
         DEVICE_INFO_MESG_MANUFACTURER,
         DEVICE_INFO_MESG_SERIAL_NUMBER,
         DEVICE_INFO_MESG_PRODUCT,
         DEVICE_INFO_MESG_SOFTWARE_VERSION,
         DEVICE_INFO_MESG_HARDWARE_VERSION,
         DEVICE_INFO_MESG_CUM_OPERATING_TIME,
         DEVICE_INFO_MESG_BATTERY_VOLTAGE,
         DEVICE_INFO_MESG_BATTERY_STATUS,
         DEVICE_INFO_MESG_CHECKSUM,
         DEVICE_INFO_MESG_FIELDS
      } DEVICE_INFO_MESG_FIELD_INDEX;

      typedef enum
      {
         HRV_MESG_TIME,
         HRV_MESG_CHECKSUM,
         HRV_MESG_FIELDS
      } HRV_MESG_FIELD_INDEX;

      typedef enum
      {
         COURSE_MESG_SPORT,
         COURSE_MESG_NAME,
         COURSE_MESG_CAPABILITIES,
         COURSE_MESG_CHECKSUM,
         COURSE_MESG_FIELDS
      } COURSE_MESG_FIELD_INDEX;

      typedef enum
      {
         COURSE_POINT_MESG_MESSAGE_INDEX,
         COURSE_POINT_MESG_TIMESTAMP,
         COURSE_POINT_MESG_POSITION_LAT,
         COURSE_POINT_MESG_POSITION_LONG,
         COURSE_POINT_MESG_DISTANCE,
         COURSE_POINT_MESG_TYPE,
         COURSE_POINT_MESG_NAME,
         COURSE_POINT_MESG_CHECKSUM,
         COURSE_POINT_MESG_FIELDS
      } COURSE_POINT_MESG_FIELD_INDEX;

      typedef enum
      {
         WORKOUT_MESG_SPORT,
         WORKOUT_MESG_CAPABILITIES,
         WORKOUT_MESG_NUM_VALID_STEPS,
         WORKOUT_MESG_WKT_NAME,
         WORKOUT_MESG_CHECKSUM,
         WORKOUT_MESG_FIELDS
      } WORKOUT_MESG_FIELD_INDEX;

      typedef enum
      {
         WORKOUT_STEP_MESG_MESSAGE_INDEX,
         WORKOUT_STEP_MESG_WKT_STEP_NAME,
         WORKOUT_STEP_MESG_DURATION_TYPE,
         WORKOUT_STEP_MESG_DURATION_VALUE,
         WORKOUT_STEP_MESG_TARGET_TYPE,
         WORKOUT_STEP_MESG_TARGET_VALUE,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH,
         WORKOUT_STEP_MESG_INTENSITY,
         WORKOUT_STEP_MESG_CHECKSUM,
         WORKOUT_STEP_MESG_FIELDS
      } WORKOUT_STEP_MESG_FIELD_INDEX;

      typedef enum
      {
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_DURATION_TIME,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_DURATION_DISTANCE,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_DURATION_HR,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_DURATION_CALORIES,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_DURATION_STEP,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_DURATION_POWER,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_SUBFIELDS,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } WORKOUT_STEP_MESG_DURATION_VALUE_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_TARGET_HR_ZONE,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_TARGET_POWER_ZONE,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_REPEAT_STEPS,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_REPEAT_TIME,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_REPEAT_DISTANCE,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_REPEAT_CALORIES,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_REPEAT_HR,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_REPEAT_POWER,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_SUBFIELDS,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } WORKOUT_STEP_MESG_TARGET_VALUE_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_CUSTOM_TARGET_SPEED_LOW,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_CUSTOM_TARGET_HEART_RATE_LOW,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_CUSTOM_TARGET_CADENCE_LOW,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_CUSTOM_TARGET_POWER_LOW,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_SUBFIELDS,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_LOW_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_CUSTOM_TARGET_SPEED_HIGH,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_CUSTOM_TARGET_HEART_RATE_HIGH,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_CUSTOM_TARGET_CADENCE_HIGH,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_CUSTOM_TARGET_POWER_HIGH,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_SUBFIELDS,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_ACTIVE_SUBFIELD = FIT_SUBFIELD_INDEX_ACTIVE_SUBFIELD,
         WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_MAIN_FIELD = FIT_SUBFIELD_INDEX_MAIN_FIELD
      } WORKOUT_STEP_MESG_CUSTOM_TARGET_VALUE_HIGH_FIELD_SUBFIELD_INDEX;

      typedef enum
      {
         TOTALS_MESG_MESSAGE_INDEX,
         TOTALS_MESG_TIMESTAMP,
         TOTALS_MESG_TIMER_TIME,
         TOTALS_MESG_DISTANCE,
         TOTALS_MESG_CALORIES,
         TOTALS_MESG_SPORT,
         TOTALS_MESG_ELAPSED_TIME,
         TOTALS_MESG_SESSIONS,
         TOTALS_MESG_CHECKSUM,
         TOTALS_MESG_FIELDS
      } TOTALS_MESG_FIELD_INDEX;

      typedef enum
      {
         WEIGHT_SCALE_MESG_TIMESTAMP,
         WEIGHT_SCALE_MESG_WEIGHT,
         WEIGHT_SCALE_MESG_PERCENT_FAT,
         WEIGHT_SCALE_MESG_PERCENT_HYDRATION,
         WEIGHT_SCALE_MESG_VISCERAL_FAT_MASS,
         WEIGHT_SCALE_MESG_BONE_MASS,
         WEIGHT_SCALE_MESG_MUSCLE_MASS,
         WEIGHT_SCALE_MESG_BASAL_MET,
         WEIGHT_SCALE_MESG_PHYSIQUE_RATING,
         WEIGHT_SCALE_MESG_ACTIVE_MET,
         WEIGHT_SCALE_MESG_METABOLIC_AGE,
         WEIGHT_SCALE_MESG_VISCERAL_FAT_RATING,
         WEIGHT_SCALE_MESG_USER_PROFILE_INDEX,
         WEIGHT_SCALE_MESG_CHECKSUM,
         WEIGHT_SCALE_MESG_FIELDS
      } WEIGHT_SCALE_MESG_FIELD_INDEX;

      typedef enum
      {
         BLOOD_PRESSURE_MESG_TIMESTAMP,
         BLOOD_PRESSURE_MESG_SYSTOLIC_PRESSURE,
         BLOOD_PRESSURE_MESG_DIASTOLIC_PRESSURE,
         BLOOD_PRESSURE_MESG_MEAN_ARTERIAL_PRESSURE,
         BLOOD_PRESSURE_MESG_MAP_3_SAMPLE_MEAN,
         BLOOD_PRESSURE_MESG_MAP_MORNING_VALUES,
         BLOOD_PRESSURE_MESG_MAP_EVENING_VALUES,
         BLOOD_PRESSURE_MESG_HEART_RATE,
         BLOOD_PRESSURE_MESG_HEART_RATE_TYPE,
         BLOOD_PRESSURE_MESG_STATUS,
         BLOOD_PRESSURE_MESG_USER_PROFILE_INDEX,
         BLOOD_PRESSURE_MESG_CHECKSUM,
         BLOOD_PRESSURE_MESG_FIELDS
      } BLOOD_PRESSURE_MESG_FIELD_INDEX;

      typedef struct
      {
         FIT_FLOAT32 scale;
         FIT_FLOAT32 offset;
         FIT_UINT8 num;
         FIT_UINT8 bits;
         FIT_BOOL accumulate;
      } FIELD_COMPONENT;

      typedef struct
      {
         FIT_SINT32 refFieldValue;
         FIT_UINT8 refFieldNum;
      } SUBFIELD_MAP;

      typedef struct
      {
         const SUBFIELD_MAP* maps;
         std::string name;
         std::string units;
         FIT_FLOAT32 scale;
         FIT_FLOAT32 offset;
         FIT_UINT8 numMaps;
         FIT_UINT8 type;
      } SUBFIELD;

      typedef struct
      {
         const FIELD_COMPONENT* components;
         const SUBFIELD* subFields;
         std::string name;
         std::string units;
         FIT_FLOAT32 scale;
         FIT_FLOAT32 offset;
         FIT_UINT16 numComponents;
         FIT_UINT16 numSubFields;
         FIT_UINT8 num;
         FIT_UINT8 type;
      } FIELD;

      typedef struct
      {
         const FIELD* fields;
         std::string name;
         FIT_UINT16 num;
         FIT_UINT16 numFields;
      } MESG;

      static const MESG mesgs[MESGS];

      static const Profile::MESG* GetMesg(const FIT_UINT16 num);
      static const Profile::MESG* GetMesg(const std::string& name);
      static const FIT_UINT16 GetFieldIndex(const FIT_UINT16 mesgNum, const FIT_UINT8 fieldNum);
      static const FIT_UINT16 GetFieldIndex(const std::string& mesgName, const std::string& fieldName);
      static const Profile::FIELD* GetField(const FIT_UINT16 mesgNum, const FIT_UINT8 fieldNum);
      static const Profile::FIELD* GetField(const std::string& mesgName, const std::string& fieldName);
      static const FIT_UINT16 GetSubFieldIndex(const std::string& mesgName, const std::string& fieldName, const std::string& subFieldName);
      static const Profile::SUBFIELD* GetSubField(const FIT_UINT16 mesgNum, const FIT_UINT8 fieldNum, const FIT_UINT16 subFieldIndex);
      static const Profile::SUBFIELD* GetSubField(const std::string& mesgName, const std::string& fieldName, const std::string& subFieldName);
};

} // namespace fit

#endif // !defined(FIT_PROFILE_HPP)
